<?php
class Tool extends AppModel {
	var $name = 'Tool';
	var $displayField = 'title';
	//The Associations below have been created with all possible keys, those that are not needed can be removed
         var $virtualFields=array(
            'display'=>'CONCAT(Tool.title)'
        );
         var $belongsTo = array(
		'User' => array(
			'className' => 'User',
			'foreignKey' => 'administrator',
		));
	var $hasMany = array(
		'Workflow' => array(
			'className' => 'Workflow',
			'foreignKey' => 'tool_id',
			'dependent' => false
		),
		'Baali' => array(
			'className' => 'Baali',
			'foreignKey' => 'tool_id',
			'dependent' => false
		)
	);


	var $hasAndBelongsToMany = array(
		'Jobprofile' => array(
			'className' => 'Jobprofile',
			'joinTable' => 'jobprofiles_tools',
			'foreignKey' => 'tool_id',
			'associationForeignKey' => 'jobprofile_id',
			'unique' => true,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'finderQuery' => '',
			'deleteQuery' => '',
			'insertQuery' => ''
		)
	);

        function getTools(){
            return $this->find('list');
        }

        function getToolsTables(){
            return $this->find('list',array('fields'=>array('table')));
        }
}
?>